﻿<%@ control language="C#" autoeventwireup="true" codefile="recent.ascx.cs" inherits="shared_recent" %>
<asp:placeholder id="plhJavaScriptUpload" runat="server" visible="false">
	<script type="text/javascript">
	//<![CDATA[
$(document).ready(function() {
	var eleRegion = $('#dashboard-max').get(0);
	var eleList = $('#recent-files li.header', eleRegion).get(0);
	var eleInputFileUpload = $('#dashboard_file_upload', eleRegion).get(0);
	var eleContainerFileUpload = $(eleInputFileUpload).parent().height(90).get(0);
	var eleError = $('<div style=\"margin:4px 0 0 2px;display:none;\" class=\"error\">&nbsp;</div>').appendTo(eleContainerFileUpload).get(0);
	$(eleInputFileUpload).fileUpload({
		uploader:'<%=ResolveClientUrl("~/js/jquery.uploadify/uploader.swf")%>',
		script:'<%=ResolveClientUrl("~/shared/file_upload.ashx")%>',
		scriptData:{
			session_id:'<%=UPLOAD_SESSION_ID%>',
			user_id:'<%=UPLOAD_USER_ID%>',
			mode:'<%=UPLOAD_MODE%>',
			id:'<%=UPLOAD_ID%>'
		},
		buttonImg:'<%=ResolveClientUrl("~/css/component/uploadify/new_file.png")%>',
		width:60,
		height:16,
		rollover:true,
		wmode:'transparent',
		cancelImg:'<%=ResolveClientUrl("~/js/jquery.uploadify/cancel.png")%>',
		folder:'/uploads',
		auto:true,
		onSelectOnce:function(e, data) {
			$(eleError).hide().html('');
		},
		onComplete:function(e, queueId, fileObj, response, data) {
			var jsonObject = YAHOO.lang.JSON.parse(response);
			if(jsonObject.strMessage == 'success') {
				$('<li style=\"display:none;\"><a title=\"<%=LINK_TITLE%>\" href=\"<%=ResolveClientUrl(LINK_URL)%>?id=' + jsonObject.intId + '\">' + jsonObject.strFileName + '</a></li>').insertAfter(eleList).fadeIn('slow');
			} else {
				$(eleError).html(jsonObject.strMessage).animate({opacity: 1.0}, 500).fadeIn('slow');
			}
		}
	});
});
	//]]>
	</script>
</asp:placeholder>
<asp:repeater id="rptrRecentItems" runat="server" enableviewstate="false" onitemcreated="rptrRecentItems_ItemCreated" onitemdatabound="rptrRecentItems_ItemDataBound" onitemcommand="rptrRecentItems_ItemCommand">
<headertemplate>
<asp:literal id="litHeader" runat="server"/>
</headertemplate>
<itemtemplate>
	<asp:literal id="litItemMarkup" runat="server"/>
</itemtemplate>
<footertemplate>
<asp:literal id="litFooter" runat="server"/>
</footertemplate>
</asp:repeater>